package com.jb.web.renderer;

import com.jb.faces.component.UIComponent;
import com.jb.web.bean.TabbedPanel;
import com.jb.web.context.WebContext;

public abstract class RegionRenderer extends RendererImpl {
    public StringBuffer renderBegin(WebContext ctx, 
                                    UIComponent itemToRender) {
        StringBuffer html = new StringBuffer();
        TabbedPanel sect = (TabbedPanel)itemToRender;
        html.append("<div ")
            .append(getEditScript(ctx, sect))
        .append(addTagProperty("stretch", sect.getStretch(), null))
        .append(addTagProperty("class", sect.getStyleClass(), null))
            .append(addTagProperty("style", sect.getStyle(ctx), null)).append(">");

        return html;
    }

    public StringBuffer renderEnd(WebContext ctx, UIComponent itemToRender) {
        return new StringBuffer("</div>");
    }
}
